home *** CD-ROM | disk | FTP | other *** search
- Subject: Re: CW9, RTTI, and ODF
- Sent: 8/12/96 10:20 PM
- Received: 8/13/96 8:51 AM
- From: Jim Lloyd, jim@melongem.com
- Reply-To: ODF Interest, ODF-Interest@CILabs.ORG
- To: OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
-
- At 12:04 PM 8/12/96, Steve Ussery wrote:
- >Kirk Swenson, (kswenson@keypress.com):
- >
- >>While this isn't really an ODF topic, I've often wondered why there hasn't
- >>been a groundswell of support from programmers for an "override" keyword in
- >>C++. If you could write
- >>
- >> override void HandleNotification( Environment*, FW_CNotification&);
- >>
- >>in a derived class declaration, then the compiler could generate an error
- >>message if no compatible virtual method were found to override, and many
- >>simple errors like this could be avoided. I suspect most C++ programmers
- >>have spent time chasing down this kind of thing at one time or another, and
- >>it seems sensible to have the language and compiler provide some
- >>assistance. The tenor of opinion on the C++ standards committee seems to
- >>be against adding new keywords to the language, however, and the
- >>standardization process is nearing completion, so I'm not holding my
- >>breath.
- >
- >I've never really thought much about this particular problem but I think
- >Kirk
- >is right. I can remember making the mistake of thinking I was overriding
- >a method in a base class when actually the prototype of the overridding
- >method
- >did not exactly match the base method. The end result was that my
- >application
- >compiled without error but behaved bizarrely. As I remember, it was a
- >very
- >difficult bug to find. (Thank goodness for source-level debuggers! I was
- >at that time stuck with only MacsBug.) Perhaps this is a defect of C++
- >that
- >should be addressed by a future standard. I would see no problem with it
- >if it was strictly optional (and therefore broke no existing code.)
- >
- >My vote, for what's worth, is that you suggest it to the C++ standards
- >committee.
-
- My 2 cents to this thread:
-
- First, Kirk's original guess is correct: the ANSI/ISO committee will not
- accept new keywords at this point in the process. If the proposal was
- accepted, it would either break almost every single C++ program currently
- existing, or it would have to be optional, in which case it serves very
- little purpose.
-
- However, I don't think there is any need for it. A good compiler can
- already issue a diagnostic for this problem. I generally consider
- Codewarrior to be pretty good, but in this case it doesn't issue a
- diagnostic. For what it's worth, Symantec's compilers will issue a
- diagnostic along the lines of "overloaded member function hides override".
- I believe Microsoft's compilers also issue a diagnostic.
-
- Jim Lloyd
-
-
-